<script id="content" type="text/template">

<!--if{parseInt(response.get.shop_order_trash)}-->
<div class="alert alert-danger" role="alert">
  <strong>注意!</strong> 该订单在 “<!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.get.shop_order_trash_time) * 1000)}-->” 已被回收。
</div>
<!--/if-->

<table class="table table-bordered">
  <tbody>
    <tr>
    	<th style="width: 120px;">订单ID：</th>
      	<td style="min-width: 100px;"><!--{response.get.shop_order_id}--></td>
    	<th style="width: 100px;">下单用户：</th>
   		<td style="min-width: 100px;">
	          <!--if{response.get.user_logo_image_id}-->
	          <img src="<!--{response.application_config.qiniu_domain+response.get.user_logo_image_id+'?imageView2/1/w/30'}-->" class="img-circle">
	          <!--/if-->
	          <!--if{response.get.user_nickname}-->
	          <!--{response.get.user_nickname}-->
	          <!--else-->
	          <span style="color: #999999;">未设置昵称</span>
	          <!--/if-->
	          <!--if{response.get.user_phone_verify_list}-->
	          	(<span style="word-wrap:break-word;"><!--{response.get.user_phone_verify_list}--></span>)
	          <!--else-->
	          <span style="color: #999999;">无认证手机</span>
	          <!--/if-->
   		</td>
    	<th style="width: 100px;">下单时间：</th>
    	<td><!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.get.shop_order_insert_time) * 1000)}--></td>
    </tr>
    <tr>
    	<th style="width: 120px;">商品合计：</th>
   		<td><!--{(parseInt(response.get.shop_order_goods_money)/100).toFixed(2)}--> 元/<!--{(response.get.shop_order_goods_credit/response.application_config.credit.scale).toFixed(response.application_config.credit.precision)}--> 积分</td>
		<th style="width: 100px;">折扣合计：</th>
		<td><!--{(parseInt(response.get.shop_order_discount_money)/100).toFixed(2)}--> 元/<!--{(response.get.shop_order_discount_credit/response.application_config.credit.scale).toFixed(response.application_config.credit.precision)}--> 积分</td>
		<th style="width: 100px;">运费：</th>
		<td>
			<!--if{response.get.shop_order_shipping_property == 0}-->
	    	<!--{(parseInt(response.get.shop_order_shipping_price)/100).toFixed(2)}--> 元
	    <!--else-->
	     	<!--{(response.get.shop_order_shipping_price/response.application_config.credit.scale).toFixed(response.application_config.credit.precision)}--> 积分
      <!--/if-->
		</td>
    </tr>
    
    <tr>
    	<th style="width: 120px;">订单总费用：</th>
    	<th style="color: red;"><!--{(parseInt(response.get.shop_order_money)/100).toFixed(2)}--> 元/<!--{(response.get.shop_order_credit/response.application_config.credit.scale).toFixed(response.application_config.credit.precision)}--> 积分</th>
    	<th style="width: 100px;">订单状态：</th>
    	<th>
    		<!--if{parseInt(response.get.shop_order_state) == 0}-->
				<span class="label label-danger">已取消</span>
				<!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.get.shop_order_close_time) * 1000)}-->
				<!--elseif{parseInt(response.get.shop_order_state) == 1}-->
				<span class="label label-success">已确认</span>
				<!--else-->
				<span class="label label-default">未知</span>
				<!--/if-->
    	</th>
    	<th style="width: 100px;">支付状态：</th>
			<td>
				<!--if{parseInt(response.get.shop_order_pay_state) == 0}-->
				<span class="label label-danger">未支付</span>
				<!--elseif{parseInt(response.get.shop_order_pay_state) == 1}-->
				<span class="label label-success">已支付</span>
				<!--elseif{parseInt(response.get.shop_order_pay_state) == 2}-->
				<span class="label label-warning">支付中</span>
				<!--else-->
				<span class="label label-default">未知</span>
				<!--/if-->
			</td>
    	
    </tr>
    
   
    
    
    <!--if{parseInt(response.get.shop_order_money)}-->
     <tr>
    	<th colspan="6" style="height: 30px;"></th>
    </tr>
    <tr>
    	<th style="width: 120px;">支付方式：</th>
   		<td colspan="5"><!--{response.get.shop_order_pay_money_method_name}--></td>
    </tr>
    <tr>
		<th style="width: 120px;">支付金额：</th>
		<th style="color: red;">
			<!--if{parseInt(response.get.shop_order_pay_money_state) == 1}-->
			<!--{(parseInt(response.get.shop_order_pay_money)/100).toFixed(2)}--> 元
			<!--/if-->
		</th>
		<th style="width: 100px;">支付状态：</th>
		<td>
			<!--if{parseInt(response.get.shop_order_pay_money_state) == 0}-->
			<span class="label label-danger">未支付</span>
			<!--elseif{parseInt(response.get.shop_order_pay_money_state) == 1}-->
			<span class="label label-success">已支付</span>
			<!--else-->
			<span class="label label-default">未知</span>
			<!--/if-->
		</td>
		<th style="width: 100px;">支付时间：</th>
   		<td>
	   		<!--if{parseInt(response.get.shop_order_pay_money_state) == 1}-->
	   		<!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.get.shop_order_pay_money_time) * 1000)}-->
	   		<!--/if-->
   		</td>
    </tr>
    <!--/if-->
   
    <!--if{parseInt(response.get.shop_order_credit)}-->
     <tr>
    	<th colspan="6" style="height: 30px;"></th>
    </tr>
    <tr>
    	<th style="width: 120px;">支付方式：</th>
   		<td colspan="5"><!--{response.get.shop_order_pay_credit_method_name}--></td>
    </tr>
    <tr>
		<th style="width: 120px;">支付数量：</th>
		<th style="color: red;">
			<!--if{parseInt(response.get.shop_order_pay_credit_state) == 1}-->
				<!--{(response.get.shop_order_pay_credit/response.application_config.credit.scale).toFixed(response.application_config.credit.precision)}--> 积分
			<!--/if-->
		</th>
		<th style="width: 100px;">支付状态：</th>
		<td>
			<!--if{parseInt(response.get.shop_order_pay_credit_state) == 0}-->
			<span class="label label-danger">未支付</span>
			<!--elseif{parseInt(response.get.shop_order_pay_credit_state) == 1}-->
			<span class="label label-success">已支付</span>
			<!--else-->
			<span class="label label-default">未知</span>
			<!--/if-->
		</td>
		<th style="width: 100px;">支付时间：</th>
   		<td>
	   		<!--if{parseInt(response.get.shop_order_pay_credit_state) == 1}-->
	   		<!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.get.shop_order_pay_credit_time) * 1000)}-->
	   		<!--/if-->
   		</td>
    </tr>
    <!--/if-->
    
    <tr>
    	<th colspan="6" style="height: 30px;"></th>
    </tr>
    <tr>
    	<th style="width: 120px;">配送方式：</th>
   		<td><!--{response.get.shipping_name}--></td>
   		<th style="width: 100px;">运单号：</th>
		<td colspan="3"><!--{response.get.shop_order_shipping_no}--></td>
    </tr>
    <tr>
		<th style="width: 120px;">收货人：</th>
   		<td><!--{response.get.user_address_consignee}--></td>
		<th style="width: 100px;">收货地址：</th>
		<td>
			<span style="color: #999;">省:</span><!--{response.get.user_address_province}-->
			<span style="color: #999;">市:</span><!--{response.get.user_address_city}-->
			<span style="color: #999;">区:</span><!--{response.get.user_address_district}-->
			<span style="color: #999;">详细地址:</span><!--{response.get.user_address_details}-->
		</td>
		<th style="width: 100px;">收货电话：</th>
   		<td><!--{response.get.user_address_phone}--></td>
    </tr>
    
    <tr>
		<th style="width: 120px;">发货时间：</th>
   		<td>
	   		<!--if{parseInt(response.get.shop_order_pay_state) != 0}-->
	   		<!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.get.shop_order_shipping_send_time) * 1000)}-->
	   		<!--/if-->
   		</td>
		<th style="width: 100px;">配送状态：</th>
		<td>
			<!--if{parseInt(response.get.shop_order_shipping_state) == 0}-->
				<!--if{parseInt(response.get.shop_order_pay_state) == 1}-->
				<span class="label label-warning">待发货</span>
				<!--else-->
				<span class="label label-danger">未发货</span>
				<!--/if-->
			<!--elseif{parseInt(response.get.shop_order_shipping_state) == 2}-->
			<span class="label label-info">运送中</span>
			<!--elseif{parseInt(response.get.shop_order_shipping_state) == 1}-->
			<span class="label label-success">已收货</span>
			<!--else-->
			<span class="label label-default">未知</span>
			<!--/if-->
		</td>
		<th style="width: 100px;">收货时间：</th>
   		<td>
	   		<!--if{parseInt(response.get.shop_order_shipping_state) == 1}-->
	   		<!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.get.shop_order_shipping_take_time) * 1000)}-->
	   		<!--/if-->
   		</td>
    </tr>
    
    
  </tbody>
</table>




<table class="table table-striped table-hover">
  <thead>
    <tr>
      	<th>#</th>	
        <th>商品名称</th>
        <th>商品货号</th>
        <th>商品规格</th>
        <th>商品单价</th>
        <th>商品数量</th>
        <th>价格合计</th>
    </tr>
  </thead>
  <tbody>
  	<!--if{response.get.shop_order_goods}-->
	<!--for{var i in response.get.shop_order_goods}-->
	
	<!--js{var shop_order_goods_json = [];}-->
	<!--if{response.get.shop_order_goods[i].shop_order_goods_json}-->
	<!--js{shop_order_goods_json = JSON.parse(response.get.shop_order_goods[i].shop_order_goods_json);}-->
	<!--/if-->
    <tr>
    	<th style="width: 5%;"><!--{parseInt(i)+1}--></th>
    	<td><a href="#/shop/goods_list/?search=%257B%2522shop_goods_id%2522%253A%2522<!--{response.get.shop_order_goods[i].shop_goods_id}-->%2522%257D"><!--{response.get.shop_order_goods[i].shop_order_goods_name}--></a></td>
    	<td><!--{response.get.shop_order_goods[i].shop_order_goods_json['sn']}--></td>
    	<td>
    		<!--{shop_order_goods_json.spu_string}-->
    	</td>
    	<td>
    		<!--if{response.get.shop_order_goods[i].shop_goods_property == 0}-->
      		<!--{(parseInt(response.get.shop_order_goods[i].shop_order_goods_price)/100).toFixed(2)}--> 元
      	<!--else-->    					<!--{(response.get.shop_order_goods[i].shop_order_goods_price/response.application_config.credit.scale).toFixed(response.application_config.credit.precision)}--> 积分
  			<!--/if-->
    	</td>
    	<td><!--{response.get.shop_order_goods[i].shop_order_goods_number}--></td>
    	<td>
    		<!--if{response.get.shop_order_goods[i].shop_goods_property == 0}-->
      		<!--{(parseInt(response.get.shop_order_goods[i].shop_order_goods_price*response.get.shop_order_goods[i].shop_order_goods_number)/100).toFixed(2)}--> 元
      	<!--else-->    					<!--{((response.get.shop_order_goods[i].shop_order_goods_price*response.get.shop_order_goods[i].shop_order_goods_number)/response.application_config.credit.scale).toFixed(response.application_config.credit.precision)}--> 积分
  			<!--/if-->
    </tr>
    <!--/for-->
    <!--else-->
    <tr>
      <td colspan="10" align="center">无数据</td>
    </tr>
	<!--/if-->	
  </tbody>
</table>


<hr/>
<div class="btn-group">
	<!--if{parseInt(response.get.shop_order_shipping_state) == 0}-->
	<button type="button" class="btn btn-default shipping_send">确定发货</button>
	<!--elseif{parseInt(response.get.shop_order_shipping_state) == 2}-->
	<button type="button" class="btn btn-default shipping_take">确定收货</button>
	<!--/if-->
	
	<!--if{parseInt(response.get.shop_order_state)}-->
	<button type="button" class="btn btn-default close_state">取消订单</button>
	<!--else-->
	<button type="button" class="btn btn-default confirm_state">确定订单</button>
	<!--/if-->
	
	<!--if{parseInt(response.get.shop_order_trash)}-->
	<button type="button" class="btn btn-default restore">还原订单</button>
	<!--else-->
	<button type="button" class="btn btn-warning trash">回收订单</button>
	<!--/if-->
</div>

<hr/>
	<span style="color: #999999;">更新时间：<!--{WangAho().date("yyyy/MM/dd HH:mm EEE", parseInt(response.get.shop_order_update_time) * 1000)}--></span>
	<div style="height: 100px;"></div>
</script>


